using System;
using System.Net.Sockets;
using System.IO;
using Servlets.Server;

namespace Servlets.Sockets
{
	
	class TcpClient : IClient
	{
		private System.Net.Sockets.TcpClient client;
		private NetworkStream stream;
		
		public TcpClient(System.Net.Sockets.TcpClient client)
		{
			this.client = client;
			this.stream = client.GetStream();
		}
		
		public StreamReader StreamReader{
			get {
				return new StreamReader(stream);
			}
		}
		
		
		public StreamWriter StreamWriter{
			get {
				return new StreamWriter(stream);
			}
		}
		
		public void Dispose()
		{
			stream.Close();
			client.Close();
		}
	}
}

